@page
@{ Layout = "_LayoutApp"; }
@section Styles{
    <style>
        body {
            margin: 0;
            padding: 0;
        }
    </style>
}
<div v-if="total>0" class="p-3">
    <div class="row g-3">
        <div class="col-xl-6 col-lg-6 col-md-6 col-6">
            <div class="card rounded-0 card-lift card-hover border bg-white p-2 mb-2 shadow-lg" v-on:click="btnViewClick(course)" style="cursor:pointer;" v-for="course in list1">
                <div class="position-relative">
                    <img :src="course.coverImg" class="img-fluid rounded-0 card-img">
                    <el-tag class="position-absolute bottom-0 end-0 m-2" size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                    <el-tag size="mini" class="bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6" v-else>{{ utils.formatDuration(course.duration) }}</el-tag>
                    <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                    <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                    <span class="position-absolute bottom-0 start-0 m-2">
                        <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                    </span>
                </div>
                <div class="p-2">
                    <div class="mb-2 fw-semibold">
                        {{ course.name }}
                    </div>
                    <div class="mb-2 lh-1 fs-6">
                        <span>
                            <i class="bi bi-star-fill text-warning me-1"></i>
                            <span>{{ course.evaluationAvg }}</span>
                        </span>
                        <span>
                            ({{ course.totaEvaluationlUser }})
                        </span>
                    </div>
                    <div class="lh-1 fs-6">
                        <span class="text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }} 学分</span>
                        <span v-else>{{ course.credit }} 学分</span>
                        <span class="ms-2">{{ course.studyHour }}</span> 课时
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-6 col-lg-6 col-md-6 col-6">
            <div class="card rounded-0 card-lift card-hover border bg-white p-2 mb-2 shadow-lg" v-on:click="btnViewClick(course)" style="cursor:pointer;" v-for="course in list2">
                <div class="position-relative">
                    <img :src="course.coverImg" class="img-fluid rounded-0 card-img">
                    <el-tag class="position-absolute bottom-0 end-0 m-2" size="mini" type="primary" effect="plain" v-if="course.offLine">面授课</el-tag>
                    <el-tag size="mini" class="bg-dark text-white position-absolute bottom-0 end-0 m-2 fs-6" v-else>{{ utils.formatDuration(course.duration) }}</el-tag>
                    <el-tag size="mini" type="success" effect="dark" class="position-absolute top-0 end-0 m-2" v-if="course.state==='Yiwancheng'">{{ course.stateStr }}</el-tag>
                    <el-tag size="mini" type="warning" effect="dark" class="position-absolute top-0 end-0 m-2" v-else>{{ course.stateStr }}</el-tag>
                    <span class="position-absolute bottom-0 start-0 m-2">
                        <el-tag size="mini" type="primary" effect="dark" class="me-1">{{ course.courseType}}</el-tag>
                    </span>
                </div>
                <div class="p-2">
                    <div class="mb-2 fw-semibold">
                        {{ course.name }}
                    </div>
                    <div class="mb-2 lh-1 fs-6">
                        <span>
                            <i class="bi bi-star-fill text-warning me-1"></i>
                            <span>{{ course.evaluationAvg }}</span>
                        </span>
                        <span>
                            ({{ course.totaEvaluationlUser }})
                        </span>
                    </div>
                    <div class="lh-1 fs-6">
                        <span class="text-success" v-if="course.state==='Yiwancheng'">{{ course.credit }} 学分</span>
                        <span v-else>{{ course.credit }} 学分</span>
                        <span class="ms-2">{{ course.studyHour }}</span> 课时
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="my-5 text-center">
        <el-button class="rounded-pill border-0" icon="el-icon-refresh-right" v-if="total>pushTotal" v-on:click="btnLoadMoreClick" :loading="loadMoreLoading">加载更多</el-button>
        <small v-else>没有更多了</small>
    </div>
    <div class="py-8"></div>
</div>
<div class="pt-8" v-else>
    <el-empty :image-size="88"></el-empty>
</div>
<div v-if="1===2" style="position:fixed;right:0;top:80%;" class="animate__animated animate__fadeInRightBig">
    <button type="button" class="btn btn-dark rounded-start-pill" v-on:click="courseDialogVisible=true">
        <i class="bi bi-search text-light"></i>
    </button>
</div>
<template>
    <el-drawer title="课程查询"
               size="90%"
               :visible.sync="courseDialogVisible"
               direction="btt">
        <div class="text-center p-2">
            <div class="card rounded-0 border mb-6 mb-md-0 shadow-none">
                <div class="card-body border-top py-3">
                    <div class="d-flex justify-content-between mt-2 text-dark">
                        <el-select v-model="form.state" clearable placeholder="学习状态" class="w-100">
                            <el-option label="全部状态"
                                       value="">
                            </el-option>
                            <el-option label="已完成"
                                       value="stateOver">
                            </el-option>
                            <el-option label="学习中"
                                       value="stateStuding">
                            </el-option>
                        </el-select>
                    </div>
                </div>
                <div class="card-body border-top py-3">
                    <div class="d-flex justify-content-between mt-2 text-dark">
                        <el-select v-model="form.orderby" clearable placeholder="默认排序" class="w-100">
                            <el-option label="默认排序"
                                       value="">
                            </el-option>
                            <el-option label="按评价"
                                       value="orderbyEvaluation">
                            </el-option>
                            <el-option label="按学习人数"
                                       value="orderbyCount">
                            </el-option>
                        </el-select>
                    </div>
                </div>
                <div class="card-body border-top py-3">
                    <div class="mt-2 text-dark">
                        <div class="text-start">
                            <el-checkbox v-model="form.collection">
                                <i class="bi bi-person-hearts me-2"></i>我的收藏
                            </el-checkbox>
                        </div>
                        <div class="my-3">
                            <el-input clearable prefix-icon="el-icon-search" v-model="form.keyWords" placeholder="关键字" class="w-100"></el-input>
                        </div>
                        <div v-if="markTotal>0" class="mt-1 p-2 bg-light rounded-3 text-start">
                            <template v-for="mark in markShowList">
                                <el-tag v-if="form.mark===mark" class="m-1" v-on:click="marChangeClick(mark)" effect="dark" type="success" style="cursor:pointer;">{{ mark }}</el-tag>
                                <el-tag v-else class="m-1" v-on:click="marChangeClick(mark)" style="cursor:pointer;" effect="plain">{{ mark }}</el-tag>
                            </template>
                            <el-tag v-on:click="moreMarkList" type="info" effect="plain" v-if="markMore" style="cursor:pointer;">more({{ markTotal-markShowList.length }})</el-tag>
                        </div>
                    </div>
                </div>
                <div class="card-body border-top py-3">
                    <el-button type="primary" plain icon="el-icon-search" v-on:click="btnSearchClick">查 询</el-button>
                    <el-button plain icon="el-icon-close" v-on:click="courseDialogVisible=false">取 消</el-button>
                </div>
            </div>
        </div>
    </el-drawer>
</template>
@section Scripts{
    <script src="/sitefiles/assets/js/app/study/studyCourse.js" type="text/javascript"></script>
}